
public class Demo {

	
	public static void main(String[] args) {
		
		int[] arr1 = {-10,-1,5,20,80,160,400};
		int[] arr2 = {-10,-5,2,8};
		int[] arr3 = new int[arr1.length + arr2.length];
		int temp;
		int m = arr1.length;
		
		for (int i = 0; i < arr1.length; i++) {
			arr3[i] = arr1[i];
		}
		
		for (int i = 0; i < arr2.length; i++) {
			arr3[i+m] = arr2[i];
		}

		for (int i = 0; i < arr3.length; i++) {
			for (int j = i; j < arr3.length; j++) {
				if(arr3[i]> arr3[j]){
					temp = arr3[i];
					arr3[i] = arr3[j];
					arr3[j]= temp; 				
				}
			}
		}
		
		for (int i = 0; i < arr3.length; i++) {
			System.out.print(arr3[i]+ " ");
		}
		
		
	}

}
